import request from "./request"

//查询学生列表,但是这条封装有误，数据调不出来，不知道为啥
export function searchStudent(data) {
  return request({
    url: '/student/search',
    data,
    method: "post",
  })
}

// 查询学生详情
export function getStudentInfo(id) {
  return request({
    url: `student/basic_infor`,
    params: { stuId: id, },
    method: "get",
  })
}
// 学生家长信息
export function getStudentParentInfo(id) {
  return request({
    url: `/student/parent_infor`,
    params: {
      stuId: id,
    },
    method: "get",
  })
}
// 获取学习科研下的学习情况数据
export function getScoreInfo(data) {
  return request({
    url: `/course_research/score`,
    data,
    method: "post",
  })
}

// 获取学习科研下的科研创新数据
export function getResearchInfo(data) {
  return request({
    url: `/course_research/research`,
    data,
    method: "post",
  })
}

// <-----------------------------Tab3  <奖惩助贷>--------------------------------------->
// <!-- -->

// 奖励数据,type{0=奖学金,1=竞赛获奖,2=助学金}
export function getAwardInfo(data) {
  return request({
    url: "/award_punishment/award",
    data,
    method: "post",
  })
}
// 勤工助学数据
export function getWorkStudy(id) {
  return request({
    url: "/award_punishment/work_study",
    params: {
      stuId: id,
    },
    method: "get",
  })
}
//贷款数据
export function getLoanInfo(data) {
  return request({
    url: "/award_punishment/loan",
    data,
    method: "post",
  })
}

// 惩罚数据
export function getPunishmentInfo(data) {
  return request({
    url: "/award_punishment/punishment",
    data,
    method: "post",
  })
}

//  <!--  ---------------------------Tab4  <第二课堂>-------------------------------------  --!>
//  1活动成长
export function getActivity(data) {
  return request({
    url: "/second/activity",
    data,
    method: "post",
  })
}
//  2深度辅导
export function getdeepCoach(data) {
  return request({
    url: "/second/deepCoach",
    data,
    method: "post",
  })
}

//  <!--  ---------------------------Tab5  <书院信息>-------------------------------------  --!>
//住宿信息
export function getDormitory(data) {
  return request({
    url: "/academy/dormitoryReward",
    data,
    method: "post",
  })
}
//室友信息
export function getRoomie(data) {
  return request({
    url: "/academy/roomie",
    data,
    method: "post",
  })
}
// 晚归
export function getBed(data) {
  return request({
    url: "/academy/bed",
    data,
    method: "post",
  })
}
// 可视化
export function getCanvas(id) {
  return request({
    url: "/academy/pie",
    params: {
      stuId: id,
    },
    method: "get",
  })
}
//  <!--  ---------------------------// 增删改接口-------------------------------------  --!>
//             1 增
export function addstudent(student) {
  return request({
    url: `/student/insert`,
    method: "post",
    data:student
  })
}

//             2 删除
export function deletestudent(stuId) {
  return request({
    url: `/student/delete/${stuId}`,
    method: "delete",
  })}
//             3 更新
export function updatestudent(student) {
  return request({
    url: `/student/update`,
    method: "put",
    data:student
  })
}
//上传
export function uploadpost(student) {
  return request({
    url: `/student/upload_icon`,
    method: "post",
    data:student
  })
}